﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CopyProp
{
    public partial class frmCommit : Form
    {
        frmMain MainForm;
        // The constructor receives a reference to mainform.
        public frmCommit(frmMain frmMain, string description, string location, string[] groups)
        {
            InitializeComponent();
            MainForm = frmMain;
            tbDescription.Text = description;
            tbLocation.Text = location;
            initializeDatagrid(groups);
        }

        private void initializeDatagrid(string[] groups)
        {
            DataGridViewTextBoxColumn group = new DataGridViewTextBoxColumn();
            group.DataPropertyName = "group";
            group.HeaderText = "Group";

            dgGroups.Columns.Add(group);

            // Bind the bindinglist to datagridview.
            dgGroups.AutoGenerateColumns = false;
            dgGroups.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dgGroups.DataSource = groups;
        }

        private void btnCopy_Click(object sender, EventArgs e)
        {

        }

        private void btnCancel_Click(object sender, EventArgs e)
        {

        }
    }
}
